﻿using System.Linq;
using ISSMoviePlex.DAL.Models;
using System.Collections.Generic;

namespace ISSMoviePlex.DAL.Repositories
{
    public class GenreRepository : BaseRepository<int, Genre, GenreRepository>
    {
        public override Genre FindById(int id)
        {
            return Context.Genres.SingleOrDefault(g => g.GenreId == id);
        }

        public Genre FindByName(string name)
        {
            return Context.Genres.SingleOrDefault(g => g.GenreName.Contains(name));
        }
        public IEnumerable<Genre> GetAllGenres()
        {
            return Context.Genres;
        }
    }
}
